package vinnichenko.lab3;

import java.io.*;

/**Class with static function(s) to make writing exception's traces into logger easier.
 * @author Igor Vinnichenko
 * @version 1.0
 */
public class StackWriter{
    /**Function to get stack trace of exception as String.
     * @param t - exception.
     * @return - string containing stack trace.
     */
    public static java.lang.String getFullStackTrace(Throwable t){
        StringWriter sw = new StringWriter();
        t.printStackTrace(new PrintWriter(sw));
        String stackTrace = sw.toString();

        return stackTrace;
    }
}